/*
 * Copyright (C) 2016 yixun All Rights Reserved.
 * 
 * SalesStatusEnum.java
 */
package com.emm.yixun.common.model.enums;

import org.apache.commons.lang.StringUtils;

import java.io.Serializable;

/**
 * 入账银行
*/
public enum BankNameEnum implements Serializable{
	    BUSINESSFLAG_1("1","华融湘江银行株洲芦淞支行预售资金监管户",null),
	    BUSINESSFLAG_2("2","建设银行株洲人民路支行",null),
	    BUSINESSFLAG_3("3","建设银行株洲人民路支行0165",null),
	    BUSINESSFLAG_4("4","浦发银行监管户",null),
	    BUSINESSFLAG_5("5","浦发银行株洲长江路支行",null),
	    BUSINESSFLAG_6("6","浦发银行株洲长江路支行0409",null),
	    BUSINESSFLAG_7("7","浦发银行株洲长江路支行保证金户",null),
	    BUSINESSFLAG_8("8","兴业银行株洲石峰支行",null),
		BUSINESSFLAG_9("9","招商银行株洲支行",null),
		BUSINESSFLAG_10("10","招商银行株洲支行预售资金监管专户",null),
		BUSINESSFLAG_11("11","中国工商银行株洲高新技术开发支行",null),
		BUSINESSFLAG_12("12","中国建设银行株洲电力支行预售资金监管户",null),
		BUSINESSFLAG_13("13","中国银行株洲清水塘支行",null),
		BUSINESSFLAG_14("14","中信银行株洲建设路支行",null),
		BUSINESSFLAG_15("15","华融湘江银行株洲芦淞支行",null),
		;

		private final String no;
		private final String des;
		private final Enum parent;

		/**
		 * 私有构造函数
		 * @param code
		 * @param description
		 */
		BankNameEnum(String no, String des, Enum parent) {
			this.no = no;
			this.des = des;
			this.parent = parent;
		}

		/**
		 * @return Returns the no.
		 */
		public String getNo() {
			return no;
		}

		/**
		 * @return Returns the des.
		 */
		public String getDes() {
			return des;
		}
		
		/**
		 * @return Returns the parent.
		 */
		public Enum getParent() {
			return parent;
		}

		/**
		 * 通过枚举<code>des</code>获得枚举
		 * 
		 * @param des
		 * @return
		 */
		public static BankNameEnum getByDescription(String des) {
			if(StringUtils.isBlank(des)){
				return null;
			}
			for (BankNameEnum menum : values()) {
				if (menum.getDes().equals(des)) {
					return menum;
				}
			}
			return null;
		}
		public static BankNameEnum getByNo(String no) {
			if(StringUtils.isBlank(no)){
				return null;
			}
			for (BankNameEnum menum : values()) {
				if (menum.getNo().equals(no)) {
					return menum;
				}
			}
			return null;
		}
}
